<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhSchoolSpecsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_school_specs', function (Blueprint $table) {
            $table->id();
            $table->integer('parentId', false, true)->index()->nullable()->comment('父级');
            $table->tinyInteger('level')->default(1)->index()->comment('级别，共三级');
            $table->string('name')->comment('名称');
            $table->string('class')->nullable()->comment('专业层次(对口类)');
            $table->string('province')->nullable()->comment('所属省份');
            $table->string('xz')->nullable()->comment('学制');
            $table->string('code')->nullable()->comment('专业代码');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE qh_school_specs comment '学校专业'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_school_specs');
    }
}
